// cd /projects/data_commons/cw_code/
// qstata cw_ind_2_fk_imp.do &

global dir_proj = "/projects/data_commons/"
global dir_cw = "${dir_proj}/cw/"
global dir_lbd = "${dir_proj}/lbd/"

di "Started at $S_DATE $S_TIME"

cd ${dir_cw}/

//==============================================================================

import delimited "cw_ind_fk_raw_man.csv", clear varn(1)

do /projects/data_commons/cw_code/cw_ind_1_jsung_fix.do
f_jsung_naics_fix "fk_naics"

count if year_min != .
list if year_min != .
drop if year_min != .

replace ch_ind = ch_ind_new if ch_ind_new != .
recast double ch_ind
replace ch_ind = round(ch_ind, 0.1)

keep ch_ind fk_naics
list if ch_ind == .
drop if ch_ind == .

save cw_ind_fk_imp, replace
saveold cw_ind_fk_imp_v12, replace v(12)
export delimited cw_ind_fk_imp.csv, replace


di "Ended at $S_DATE $S_TIME"
// End of do file
